# Maintainer: Antonio Rojas <arojas@archlinux.org>

pkgname=audiotube
pkgver=23.04.1
pkgrel=2
pkgdesc='Client for YouTube Music'
url='https://apps.kde.org/audiotube/'
arch=(x86_64)
license=(GPL LGPL)
groups=(kde-applications kde-multimedia)
depends=(kirigami-addons qt5-imageformats qt5-multimedia qt5-svg ki18n kcrash kwindowsystem yt-dlp python-ytmusicapi)
makedepends=(extra-cmake-modules pybind11)
source=(https://download.kde.org/stable/release-service/$pkgver/src/$pkgname-$pkgver.tar.xz{,.sig}
        58460cf3.patch)
sha256sums=('60c688ccb1ff82d66f2924984d66f5dbd91937bb8fd69cae9b81298454dc9b5e'
            'SKIP'
            'b677e09feb97808b2fd9653ff645ff3188fb0bccd1c8b06c35035233382fc465')
validpgpkeys=(CA262C6C83DE4D2FB28A332A3A6A4DB839EAA6D7  # Albert Astals Cid <aacid@kde.org>
              F23275E4BF10AFC1DF6914A6DBD2CE893E2D1C87  # Christoph Feck <cfeck@kde.org>
              D81C0CB38EB725EF6691C385BB463350D6EF31EF) # Heiko Becker <heiko.becker@kde.org>

prepare() {
  patch -d $pkgname-$pkgver -p1 < 58460cf3.patch # Support ytmusicapi 1.0
}

build() {
  cmake -B build -S $pkgname-$pkgver \
    -DBUILD_TESTING=OFF
  cmake --build build
}

package() {
  DESTDIR="$pkgdir" cmake --install build
}
